<!DOCTYPE html>
<!--
Author: zouy
Unit: D9lab
Date: 2017-12-07 20:36 
-->
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>title</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
    <link href="common/css/validate.css" rel="stylesheet">

    <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/angular.js/1.5.0/angular.min.js"></script>
    <script src="common/template/baseModule.js"></script>
</head>
<body ng-app="m" ng-controller="c" style="padding-top: 50px;">
<script>
    angular.module("m",["baseModule"])
        .controller("c",function ($scope, entity, ajax) {
            $scope.entity = entity.getEntity(
                {
                    password: "",
                    name: "",
                    tel: "",
                    email: "",
                    description: "",
                    img: ""
                }, {
                    //password: {},
                    name: {},
                    tel: {},
                    email: {},
                    description: {}
                },function(){
                    console.log("opened!");
                }, function () {
                    console.log("submited!");
                }, "modal", null);
            $scope.entity1 = {
                password: "1",
                name: "2",
                tel: "3",
                email: "4",
                description: "5",
                img: "http://ouq6u283u.bkt.clouddn.com/17-10-24-18:47springfirst.jpg",
                openView: function () {
                    $("#modal1").modal("show");
                }
            };
            ajax.ajax("http://localhost:8080/server/customer/getCustomer","POST",{
                userId: 1,
                customerId: 1093
            }).success(function (data) {
                console.log(data);
            });
        });
</script>

<div entity-modal="modal" title="新增 用户" action="add" entity="entity">
    <entity-modal-body>
        <div entity-edit-text="password" type="password" title="密码" entity="entity.entity"></div>
        <div entity-edit-text="name" type="text" title="姓名" entity="entity.entity" e="entity" vld="entity.validate"></div>
        <div entity-edit-text="tel" type="tel" title="电话" entity="entity.entity" e="entity" vld="entity.validate"></div>
        <div entity-edit-text="email" type="email" title="邮箱" entity="entity.entity" e="entity" vld="entity.validate"></div>
        <div entity-edit-textarea="description" title="个人介绍" entity="entity.entity" e="entity" vld="entity.validate"></div>
        <div entity-edit-img="img" title="图片" entity="entity.entity"></div>
    </entity-modal-body>
</div>

<div entity-modal-view="modal1" title="查看 用户" action="view" entity="entity1">
    <entity-modal-view-body>
        <div entity-view-tag="entity1.password" type="password" title="密码"></div>
        <div entity-view-tag="entity1.name" type="text" title="姓名"></div>
        <div entity-view-tag="entity1.tel" type="text" title="电话"></div>
        <div entity-view-tag="entity1.email" type="text" title="邮箱"></div>
        <div entity-view-tag="entity1.description" type="textarea" title="个人介绍"></div>
        <div entity-view-tag="entity1.img" type="img" title="图片"></div>
    </entity-modal-view-body>
</div>

<div class="form-horizontal">
    <div entity-right-button="open add" clas="success" click="entity._openModal()"></div>
    <div entity-right-button="open view" clas="primary" click="entity1.openView()"></div>
</div>

<script>

</script>
</body>
</html>